package ch1;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public class SetTest2 {

	public static void main(String[] args) {
		Set s = new HashSet();
		s.add(new Person("老吴", 24, "男"));
		s.add(new Person("老徐", 22, "男"));
		s.add(new Person("老张", 23, "妖"));
		s.add(new Person("老孔", 34, "女"));
		s.add(new Person("小赵", 20, "男"));
		s.add(new Person("小赵", 20, "女"));
		System.out.println(s.size());// 5 or 6 ？
		Iterator ir = s.iterator();
		while (ir.hasNext()) {
			Person p = (Person) ir.next();
			System.out.println(p);
		}
	}

}
